<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">

    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

    <script type="application/javascript" src='https://zilliz.gitee.io/welcome/js/theme-mode.js'></script>
    <link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/frameworks.min.css' />
    <link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/github.min.css' />
    <link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/github-style.css' />
    <link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/light.css' />
    <link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/dark.css' />
    <link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/syntax.css' />
    <title>towhee - 你好👋，数据探索者</title>
    
    <link rel="icon" type="image/x-icon" href='/images/github.svg'>
    
    <meta name="theme-color" content="#1e2327">

    
    <meta name="description"
  content="" />
<meta name="keywords"
  content='zilliz, milvus, towhee, attu, vector database, 向量数据库' />
<meta name="robots" content="noodp" />
<link rel="canonical" href="https://zilliz.gitee.io/welcome/project/towhee/" />


<meta property="og:type" content="article" />
<meta property="og:title" content="towhee - 你好👋，数据探索者">
<meta property="og:description"
  content="" />
<meta property="og:url" content="https://zilliz.gitee.io/welcome/project/towhee/" />
<meta property="og:site_name" content="towhee" />
<meta property="og:image"
  content="https://zilliz.gitee.io/welcome">
<meta property="og:image:width" content="2048">
<meta property="og:image:height" content="1024">

<meta property="article:published_time" content="2021-11-30 10:24:00 &#43;0800 &#43;0800" />









<script async src="https://www.googletagmanager.com/gtag/js?id=G-M9ER0FSQTM"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-M9ER0FSQTM');
</script>

</head>

<body>
  <div style="position: relative">
  <header class="Header js-details-container Details px-3 px-md-4 px-lg-5 flex-wrap flex-md-nowrap open Details--on">
    <div class="Header-item mobile-none" style="margin-top: -4px; margin-bottom: -4px;">
      <a class="Header-link" href="https://zilliz.gitee.io/welcome">
        <svg class="octicon" height="32" viewBox="0 0 16 16" version="1.1" width="32">
          <path fill-rule="evenodd"
            d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z">
          </path>
        </svg>
      </a>
    </div>
    <div class="Header-item d-md-none">
      <button class="Header-link btn-link js-details-target" type="button"
        onclick="document.querySelector('#header-search').style.display = document.querySelector('#header-search').style.display == 'none'? 'block': 'none'">
        <svg height="24" class="octicon octicon-three-bars" viewBox="0 0 16 16" version="1.1" width="24">
          <path fill-rule="evenodd"
            d="M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z">
          </path>
        </svg>
      </button>
    </div>
    <div style="display: none;" id="header-search"
      class="Header-item Header-item--full flex-column flex-md-row flex-order-2 flex-md-order-none mr-0 mr-md-3 mt-3 mt-md-0 Details-content--hidden-not-important d-md-flex">
      <div
        class="Header-search header-search flex-auto js-site-search position-relative flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to">
        <div class="position-relative">
          <form target="_blank" action="https://www.google.com/search" accept-charset="UTF-8" method="get"
            autocomplete="off">
            <label
              class="Header-search-label form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center">
              <input type="text"
                class="Header-search-input form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable"
                name="q" value="" placeholder="Search" autocomplete="off">
              <input type="hidden" name="q" value="site:https://zilliz.gitee.io/welcome">
            </label>
          </form>
        </div>
      </div>
    </div>


    <style>
  
      a.convention {
        position: relative;
        display: none;
        color: #03e9f4;
        font-size: 16px;
        text-decoration: none;
        text-transform: uppercase;
        overflow: hidden;
        transition: .5s;
        letter-spacing: 4px;
        margin-right: 5px;
      }
      
      a.convention:hover {
        background: #03e9f4;
        color: #fff;
        border-radius: 5px;
        box-shadow: 0 0 5px #03e9f4,
                    0 0 25px #03e9f4,
                    0 0 50px #03e9f4,
                    0 0 100px #03e9f4;
      }
      
      a.convention span {
        position: absolute;
        display: block;
      }
      
      a.convention span:nth-child(1) {
        top: 0;
        left: -100%;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, #03e9f4);
        animation: btn-anim1 1s linear infinite;
      }
      
      @keyframes btn-anim1 {
        0% {
          left: -100%;
        }
        50%,100% {
          left: 100%;
        }
      }
      
      a.convention span:nth-child(2) {
        top: -100%;
        right: 0;
        width: 2px;
        height: 100%;
        background: linear-gradient(180deg, transparent, #03e9f4);
        animation: btn-anim2 1s linear infinite;
        animation-delay: .25s
      }
      
      @keyframes btn-anim2 {
        0% {
          top: -100%;
        }
        50%,100% {
          top: 100%;
        }
      }
      
      a.convention span:nth-child(3) {
        bottom: 0;
        right: -100%;
        width: 100%;
        height: 2px;
        background: linear-gradient(270deg, transparent, #03e9f4);
        animation: btn-anim3 1s linear infinite;
        animation-delay: .5s
      }
      
      @keyframes btn-anim3 {
        0% {
          right: -100%;
        }
        50%,100% {
          right: 100%;
        }
      }
      
      a.convention span:nth-child(4) {
        bottom: -100%;
        left: 0;
        width: 2px;
        height: 100%;
        background: linear-gradient(360deg, transparent, #03e9f4);
        animation: btn-anim4 1s linear infinite;
        animation-delay: .75s
      }
      
      @keyframes btn-anim4 {
        0% {
          bottom: -100%;
        }
        50%,100% {
          bottom: 100%;
        }
      }
          </style>
      
      <a class="convention" href="#"><span></span><span></span><span></span><span></span>
        向量连接一切：Milvus 重磅会议即将上线，敬请期待
      </a>

    <div class="Header-item Header-item--full flex-justify-center d-md-none position-relative">
      <a class="Header-link " href="https://zilliz.gitee.io/welcome">
        <svg class="octicon octicon-mark-github v-align-middle" height="32" viewBox="0 0 16 16" version="1.1"
          width="32">
          <path fill-rule="evenodd"
            d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z">
          </path>
        </svg>
      </a>
    </div>
    <div class="Header-item" style="margin-right: 0;">
      <a href="javascript:void(0)" class="Header-link no-select" onclick="switchTheme()">
        <svg style="fill: var(--color-profile-color-modes-toggle-moon);" class="no-select" viewBox="0 0 16 16"
          version="1.1" width="16" height="16">
          <path fill-rule="evenodd" clip-rule="evenodd"
            d="M4.52208 7.71754C7.5782 7.71754 10.0557 5.24006 10.0557 2.18394C10.0557 1.93498 10.0392 1.68986 10.0074 1.44961C9.95801 1.07727 10.3495 0.771159 10.6474 0.99992C12.1153 2.12716 13.0615 3.89999 13.0615 5.89383C13.0615 9.29958 10.3006 12.0605 6.89485 12.0605C3.95334 12.0605 1.49286 10.001 0.876728 7.24527C0.794841 6.87902 1.23668 6.65289 1.55321 6.85451C2.41106 7.40095 3.4296 7.71754 4.52208 7.71754Z">
          </path>
        </svg>
      </a>
    </div>
  </header>
</div>

  
<div>
  <main>
    <div class="gisthead pagehead bg-gray-light pb-0 pt-3 mb-4">
      <div class="px-0">
        <div class="mb-3 d-flex px-3 px-md-3 px-lg-5">
          <div class="flex-auto min-width-0 width-fit mr-3">
            <div class="d-flex">
              <div class="d-none d-md-block">
                <a class="avatar mr-2 flex-shrink-0" href="https://zilliz.gitee.io/welcome">
                  <img class=" avatar-user"
                    src="https://zilliz.gitee.io/welcome/images/avatar.png"
                    width="32" height="32"></a>
              </div>
              <div class="d-flex flex-column">
                <h1 class="break-word f3 text-normal mb-md-0 mb-1">
                  <span class="author">
                    
                    <a href="https://github.com/towhee-io" target="_blank">towhee-io</a></span><span
                    class="path-divider">/</span><strong class="css-truncate-target mr-1" style="max-width: 410px"><a
                      href="https://zilliz.gitee.io/welcome/project/towhee/">towhee</a></strong>
                </h1>
                <div class="note m-0">
                  Created <relative-time datetime="Tue, 30 Nov 2021 10:24:00 &#43;0800"
                    class="no-wrap">
                    Tue, 30 Nov 2021 10:24:00 &#43;0800</relative-time>

                  
                  <span class="file-info-divider"></span>
                  Modified <relative-time datetime="Wed, 03 Dec 2025 22:22:57 &#43;0000"
                    class="no-wrap">
                    Wed, 03 Dec 2025 22:22:57 &#43;0000</relative-time>
                  
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container-lg px-3 new-discussion-timeline">
      <div class="repository-content gist-content">
        <div>
          <div class="js-gist-file-update-container js-task-list-container file-box">
            <div id="file-pytest" class="file my-2">
              <div id="post-header" class="file-header d-flex flex-md-items-center flex-items-start sticky-header" style="z-index: 2">
                <div class="file-info d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto">
                  <div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1 mt-2 mt-md-0">
                    
                    <summary id="toc-toggle" onclick="clickToc()" class="btn btn-octicon m-0 mr-2 p-2">
                      <svg aria-hidden="true" viewBox="0 0 16 16" height="16" width="16" class="octicon octicon-list-unordered">
                        <path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
                      </svg>
                    </summary>
                    <details-menu class="SelectMenu" id="toc-details" style="display: none;">
                      <div class="SelectMenu-modal rounded-3 mt-1" style="max-height: 340px;">
                        <div class="SelectMenu-list SelectMenu-list--borderless p-2" style="overscroll-behavior: contain;" id="toc-list">
                        </div>
                      </div>
                    </details-menu>
                      1766 Words
                    

                  </div>
                  <div class="file-actions flex-order-2 pt-0">
                    
                  </div>
                </div>
              </div>


              <div class="Box-body px-5 pb-5" style="z-index: 1">
                <article class="markdown-body entry-content container-lg"><p> </p>
<p align="center">
    <img src="https://towhee-io.gitee.io/towhee/towhee_logo.png#gh-light-mode-only" width="60%"/>
    <img src="https://towhee-io.gitee.io/towhee/towhee_logo_dark.png#gh-dark-mode-only" width="60%"/>
</p>
<h3 align="center">
  <p style="text-align: center;"> <span style="font-weight: bold; font: Arial, sans-serif;">x</span>2vec, Towhee is all you need! </p>
</h3>
<div class="column" align="middle">
  <a href="https://slack.towhee.io">
    <img src="https://img.shields.io/badge/join-slack-orange?style=flat" alt="join-slack"/>
  </a>
  <a href="https://twitter.com/towheeio">
    <img src="https://img.shields.io/badge/follow-twitter-blue?style=flat" alt="twitter"/>
  </a>
  <a href="https://www.apache.org/licenses/LICENSE-2.0">
    <img src="https://img.shields.io/badge/license-apache2.0-green?style=flat" alt="license"/>
  </a>
  <a href="https://github.com/towhee-io/towhee/actions/workflows/pylint.yml">
    <img src="https://img.shields.io/github/workflow/status/towhee-io/towhee/Workflow%20for%20pylint/main?label=pylint&style=flat" alt="github actions"/>
  </a>
  <a href="https://app.codecov.io/gh/towhee-io/towhee">
    <img src="https://img.shields.io/codecov/c/github/towhee-io/towhee?style=flat" alt="coverage"/>
  </a>
</div>
<p> </p>
<p><a href="https://towhee.io">Towhee</a> 可以让用户像搭积木一样，轻松地完成 AI 应用程序的构建和落地。</p>
<p>通过使用神经网络数据处理流水线(neural data processing pipeline)的方式，我们可以将 Towhee 社区中数百个现成的模型、算法组合为标准的 AI 流水线。不仅如此，你还可以使用 Towhee 提供的 Pythonic API 来完成各种 AI 流水线和 AI 应用的原型设计，享受自动代码优化，低成本实现生产环境的应用性能优化。</p>
<h2 id="-项目特点">✨ 项目特点</h2>
<p>🎨  <strong>多模态数据支持</strong>：支持不同模态的数据处理，包括：图像、视频、文本、音频、分子结构等。</p>
<p>🎓  <strong>SOTA 模型</strong> 提供跨 5 个领域（CV、NLP、多模态、音频、医学）、15 种任务、140 个模型架构、700 个预训练的 SOTA 模型（例如：BERT、CLIP、ViT、SwinTransformer、MAE、data2vec 等）。</p>
<p>📦  <strong>数据处理</strong> 除了神经网络模型，Towhee 同时提供了丰富的传统数据处理算子，包括：视频解码（Video decoding）、音频切片（audio slicing）、帧采样（frame sampling）、特征向量降维（feature vector dimension reduction）、模型融合（model ensemble）、数据库操作（database operations）等。配合各种模型、算法、数据处理方法，用户可以构建端到端的数据处理流水线。</p>
<p>🐍  <strong>Pythonic API:</strong> 恪守 “Pythonic”，提供简洁、优雅、地道的 Python API。支持链式调用，能够快速定义富有表现力的数据处理流水线，让你处理非结构化数据和像处理表格数据一样简单。</p>
<h2 id="-近期动态">📰 近期动态</h2>
<p><strong>v0.7.1 2022年7月1日</strong></p>
<ul>
<li>新增一个图片嵌入模型（image embedding）:
<a href="https://towhee.io/image-embedding/mpvit"><em>MPViT</em></a>.</li>
<li>添加两个视频检索模型（video retrieval）:
<a href="https://towhee.io/video-text-embedding/bridge-former"><em>BridgeFormer</em></a>,
<a href="https://towhee.io/video-text-embedding/collaborative-experts"><em>collaborative-experts</em></a>.</li>
<li>添加 FAISS-based ANNSearch 算子: <em>to_faiss</em>, <em>faiss_search</em>.</li>
</ul>
<p><strong>v0.7.0 2022年6月24日</strong></p>
<ul>
<li>添加六个视频理解/分类模型（video understanding/classification）
<a href="https://towhee.io/action-classification/video-swin-transformer"><em>Video Swin Transformer</em></a>,
<a href="https://towhee.io/action-classification/tsm"><em>TSM</em></a>,
<a href="https://towhee.io/action-classification/uniformer"><em>Uniformer</em></a>,
<a href="https://towhee.io/action-classification/omnivore"><em>OMNIVORE</em></a>,
<a href="https://towhee.io/action-classification/timesformer"><em>TimeSformer</em></a>,
<a href="https://towhee.io/action-classification/movinet"><em>MoViNets</em></a>.</li>
<li>添加四个视频检索模型（video retrieval）
<a href="https://towhee.io/video-text-embedding/clip4clip"><em>CLIP4Clip</em></a>,
<a href="https://towhee.io/video-text-embedding/drl"><em>DRL</em></a>,
<a href="https://towhee.io/video-text-embedding/frozen-in-time"><em>Frozen in Time</em></a>,
<a href="https://towhee.io/video-text-embedding/mdmmt"><em>MDMMT</em></a>.</li>
</ul>
<p><strong>v0.6.1 2022年5月13日</strong></p>
<ul>
<li>添加三个文本图像检索模型（text-image retrieval）：
<a href="https://towhee.io/image-text-embedding/clip"><em>CLIP</em></a>,
<a href="https://towhee.io/image-text-embedding/blip"><em>BLIP</em></a>,
<a href="https://towhee.io/image-text-embedding/lightningdot"><em>LightningDOT</em></a>.</li>
<li>从 PyTorchVideo 添加六个视频理解/分类模型（video understanding/classification）：
<a href="https://towhee.io/action-classification/pytorchvideo"><em>I3D</em></a>,
<a href="https://towhee.io/action-classification/pytorchvideo"><em>C2D</em></a>,
<a href="https://towhee.io/action-classification/pytorchvideo"><em>Slow</em></a>,
<a href="https://towhee.io/action-classification/pytorchvideo"><em>SlowFast</em></a>,
<a href="https://towhee.io/action-classification/pytorchvideo"><em>X3D</em></a>,
<a href="https://towhee.io/action-classification/pytorchvideo"><em>MViT</em></a>.</li>
</ul>
<h2 id="-快速入门">🎓 快速入门</h2>
<p>Towhee 需要 Python 3.6 及以上的运行环境，可以通过 <code>pip</code> 来完成快速安装：</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install towhee towhee.models
</span></span></code></pre></div><p>安装就绪后，就能够创建你的第一个 AI 流水线啦。下面示例中，我们使用 15 行左右的代码，来创建一个基于 CLIP 的跨模态检索流水线。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">towhee</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 创建 image embeddings 并构建索引</span>
</span></span><span class="line"><span class="cl"><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">towhee</span><span class="o">.</span><span class="n">glob</span><span class="p">[</span><span class="s1">&#39;file_name&#39;</span><span class="p">](</span><span class="s1">&#39;./*.png&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">image_decode</span><span class="p">[</span><span class="s1">&#39;file_name&#39;</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">]()</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">image_text_embedding</span><span class="o">.</span><span class="n">clip</span><span class="p">[</span><span class="s1">&#39;img&#39;</span><span class="p">,</span> <span class="s1">&#39;vec&#39;</span><span class="p">](</span><span class="n">model_name</span><span class="o">=</span><span class="s1">&#39;clip_vit_b32&#39;</span><span class="p">,</span> <span class="n">modality</span><span class="o">=</span><span class="s1">&#39;image&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">tensor_normalize</span><span class="p">[</span><span class="s1">&#39;vec&#39;</span><span class="p">,</span><span class="s1">&#39;vec&#39;</span><span class="p">]()</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">to_faiss</span><span class="p">[(</span><span class="s1">&#39;file_name&#39;</span><span class="p">,</span> <span class="s1">&#39;vec&#39;</span><span class="p">)](</span><span class="n">findex</span><span class="o">=</span><span class="s1">&#39;./index.bin&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 通过指定文本进行内容检索</span>
</span></span><span class="line"><span class="cl"><span class="n">results</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">towhee</span><span class="o">.</span><span class="n">dc</span><span class="p">[</span><span class="s1">&#39;text&#39;</span><span class="p">]([</span><span class="s1">&#39;puppy Corgi&#39;</span><span class="p">])</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">image_text_embedding</span><span class="o">.</span><span class="n">clip</span><span class="p">[</span><span class="s1">&#39;text&#39;</span><span class="p">,</span> <span class="s1">&#39;vec&#39;</span><span class="p">](</span><span class="n">model_name</span><span class="o">=</span><span class="s1">&#39;clip_vit_b32&#39;</span><span class="p">,</span> <span class="n">modality</span><span class="o">=</span><span class="s1">&#39;text&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">tensor_normalize</span><span class="p">[</span><span class="s1">&#39;vec&#39;</span><span class="p">,</span> <span class="s1">&#39;vec&#39;</span><span class="p">]()</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">faiss_search</span><span class="p">[</span><span class="s1">&#39;vec&#39;</span><span class="p">,</span> <span class="s1">&#39;results&#39;</span><span class="p">](</span><span class="n">findex</span><span class="o">=</span><span class="s1">&#39;./index.bin&#39;</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">          <span class="o">.</span><span class="n">select</span><span class="p">[</span><span class="s1">&#39;text&#39;</span><span class="p">,</span> <span class="s1">&#39;results&#39;</span><span class="p">]()</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span></code></pre></div><p>程序执行完毕，结果如下：</p>
<img src="../../images/towhee_example.png" style="width: 60%; height: 60%">
<p>不够过瘾，想要了解更多例子吗？那么来👉 <a href="https://codelabs.towhee.io/">Towhee 训练营</a> 👈 看看吧！</p>
<h2 id="-核心概念">🚀 核心概念</h2>
<p>Towhee 由四个主要模块组成：“算子（Operators）”、“流水线（Pipelines）”、“数据处理 API（DataCollection API）”和“执行引擎（Engine）”。</p>
<ul>
<li>
<p><strong>算子（Operator）</strong>：算子是构成神经网络数据处理水流线(neural data processing pipeline)的“积木块”（基础组件）。这些基础组件按照任务类型进行组织，每种任务类型都具有标准的调用接口。一个算子可以是某种神经网络模型，某种数据处理方法，或是某个 Python 函数。</p>
</li>
<li>
<p><strong>流水线（Pipeline）</strong>：流水线是由若干个算子组成的 DAG（有向无环图）。流水线可以实现比单个算子更复杂的功能，诸如特征向量提取、数据标记、跨模态数据理解等。</p>
</li>
<li>
<p><strong>数据处理 API（DataCollection）</strong>: DataCollection API 是用于描述流水线的编程接口。基于 DataCollection 定义的流水线，既可以在 Jupyter Notebook 中本地运行，支持快速原型设计，也可以通过自动优化，一键构建出满足生产需要的高性能流水线服务，以及对应的 Docker 镜像。</p>
</li>
<li>
<p><strong>执行引擎（Engine）</strong>: 执行引擎负责实例化流水线、任务调度、资源管理，以及运行期性能优化。面向快速原型构建，Towhee 提供了轻量级的本地执行引擎；面向生产环境需求，Towhee 提供了基于 Nvidia Triton 的高性能执行引擎。</p>
</li>
</ul>
<h2 id="-了解--加入社区">🏠 了解 &amp; 加入社区</h2>
<p><strong>编写代码并不是参与项目的唯一方式！</strong></p>
<p>你可以通过很多方式来参与 Towhee 社区：提交问题、回答问题、改进文档、加入社群讨论、参加线下 Meetup 活动等。</p>
<p>你的参与对于项目的持续健康发展至关重要。欢迎查阅🎁<a href="https://github.com/towhee-io/towhee/blob/main/CONTRIBUTING.md">贡献页面</a> 的文档内容，了解更多详细信息。</p>
<h3 id="-致谢">💥 致谢</h3>
<p>特别感谢下面的同学为 Towhee 社区做出的贡献 🌹：</p>
<p><br><!-- Do not remove start of hero-bot --><br>
<img src="https://img.shields.io/badge/all--contributors-27-orange"><br>
<a href="https://github.com/Chiiizzzy"><img src="https://avatars.githubusercontent.com/u/72550076?v=4" width="30px" /></a>
<a href="https://github.com/GuoRentong"><img src="https://avatars.githubusercontent.com/u/57477222?v=4" width="30px" /></a>
<a href="https://github.com/Tumao727"><img src="https://avatars.githubusercontent.com/u/20420181?v=4" width="30px" /></a>
<a href="https://github.com/binbinlv"><img src="https://avatars.githubusercontent.com/u/83755740?v=4" width="30px" /></a>
<a href="https://github.com/derekdqc"><img src="https://avatars.githubusercontent.com/u/11754703?v=4" width="30px" /></a>
<a href="https://github.com/filip-halt"><img src="https://avatars.githubusercontent.com/u/81822489?v=4" width="30px" /></a>
<a href="https://github.com/fzliu"><img src="https://avatars.githubusercontent.com/u/6334158?v=4" width="30px" /></a>
<a href="https://github.com/gexy185"><img src="https://avatars.githubusercontent.com/u/103474331?v=4" width="30px" /></a>
<a href="https://github.com/jaelgu"><img src="https://avatars.githubusercontent.com/u/86251631?v=4" width="30px" /></a>
<a href="https://github.com/jeffoverflow"><img src="https://avatars.githubusercontent.com/u/24581746?v=4" width="30px" /></a>
<a href="https://github.com/jennyli-z"><img src="https://avatars.githubusercontent.com/u/93511422?v=4" width="30px" /></a>
<a href="https://github.com/jingkl"><img src="https://avatars.githubusercontent.com/u/34296482?v=4" width="30px" /></a>
<a href="https://github.com/jinlingxu06"><img src="https://avatars.githubusercontent.com/u/106302799?v=4" width="30px" /></a>
<a href="https://github.com/junjiejiangjjj"><img src="https://avatars.githubusercontent.com/u/14136703?v=4" width="30px" /></a>
<a href="https://github.com/krishnakatyal"><img src="https://avatars.githubusercontent.com/u/37455387?v=4" width="30px" /></a>
<a href="https://github.com/omartarek206"><img src="https://avatars.githubusercontent.com/u/40853054?v=4" width="30px" /></a>
<a href="https://github.com/oneseer"><img src="https://avatars.githubusercontent.com/u/28955741?v=4" width="30px" /></a>
<a href="https://github.com/pravee42"><img src="https://avatars.githubusercontent.com/u/65100038?v=4" width="30px" /></a>
<a href="https://github.com/reiase"><img src="https://avatars.githubusercontent.com/u/5417329?v=4" width="30px" /></a>
<a href="https://github.com/shiyu22"><img src="https://avatars.githubusercontent.com/u/53459423?v=4" width="30px" /></a>
<a href="https://github.com/soulteary"><img src="https://avatars.githubusercontent.com/u/1500781?v=4" width="30px" /></a>
<a href="https://github.com/sre-ci-robot"><img src="https://avatars.githubusercontent.com/u/56469371?v=4" width="30px" /></a>
<a href="https://github.com/sutcalag"><img src="https://avatars.githubusercontent.com/u/83750738?v=4" width="30px" /></a>
<a href="https://github.com/wxywb"><img src="https://avatars.githubusercontent.com/u/5432721?v=4" width="30px" /></a>
<a href="https://github.com/zc277584121"><img src="https://avatars.githubusercontent.com/u/17022025?v=4" width="30px" /></a>
<a href="https://github.com/zhousicong"><img src="https://avatars.githubusercontent.com/u/7541863?v=4" width="30px" /></a>
<a href="https://github.com/zhujiming"><img src="https://avatars.githubusercontent.com/u/18031320?v=4" width="30px" /></a>
<br><!-- Do not remove end of hero-bot --><br></p>
<p>如果你正在寻找用于存储和检索向量的数据库，不妨看看<a href="https://github.com/milvus-io/milvus">Milvus</a>。</p></article>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
</div>
<script type="application/javascript" src='https://zilliz.gitee.io/welcome/js/toc.js'></script>
<link rel="stylesheet" href='https://zilliz.gitee.io/welcome/css/toc.css' />

  <div class="footer container-xl width-full p-responsive">
  <div
    class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between flex-sm-items-center pt-6 pb-2 mt-6 f6 text-gray border-top border-gray-light ">
    <a aria-label="Homepage" title="GitHub" class="footer-octicon d-none d-lg-block mr-lg-4" href="https://zilliz.gitee.io/welcome">
      <svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24">
        <path fill-rule="evenodd"
          d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z">
        </path>
      </svg>
    </a>
    <ul class="list-style-none d-flex flex-wrap col-12 flex-justify-center flex-lg-justify-between mb-2 mb-lg-0">
      <li class="mr-3 mr-lg-0"></li>
    </ul>
  </div>
  <div class="d-flex flex-justify-center pb-6">
    <span class="f6 text-gray-light"></span>
  </div>


</div>
</body>

<script type="application/javascript" src="https://zilliz.gitee.io/welcome/js/github-style.js"></script>




</html>